
#include "NodeDistance.h"

using namespace npInterpreter;


NodeDistance::NodeDistance() : Node() // class inheritance
{
    //To initialize data member;
    this->distance = "";
}

NodeDistance::~NodeDistance()
{
    //To delete dynamic data member
}

NodeDistance::NodeDistance(const NodeDistance& cpy) : Node(cpy)// class inheritance
{
    //To copy data member
    this->distance = cpy.distance;
}

NodeDistance& NodeDistance::operator=(const NodeDistance& asn)
{
    if (this == &asn)
    {
        return *this;
    }
    else
    {
        //To invoke base class operator=
        Node::operator=(asn);
        //To assign data member, note to delete dynamic member if exists.
        this->distance = asn.distance;

        return *this;
    }
}

NodeDistance::NodeDistance(NodeDistance&& mov) noexcept : Node(move(mov)) // class inheritance
{
    //to move data
    this->distance = move(mov.distance);
}

NodeDistance& NodeDistance::operator=(NodeDistance&& mva) noexcept
{
    if (this == &mva)
    {
        return *this;
    }
    else
    {
        //to inform base class to move data
        Node::operator=(move(mva));
        // to move data
        this->distance = move(mva.distance);

        return *this;
    }
}

NodeDistance* NodeDistance::clone() const
{
    //return new
    return new NodeDistance(*this);
}

//other constructors
NodeDistance::NodeDistance(const string& distance) : Node()
{
    this->distance = distance;
}

//public methods
string NodeDistance::interpret() throw()
{
    return this->distance;
}

//protected methods

//private methods

//others
